<template>
    <div>
        <TypeNav></TypeNav>
        <ListContainer></ListContainer>
        <ReComend></ReComend>
        <Rank></Rank>
        <Like></Like>
        <Floor v-for="floor in floorList.slice(0,1)" :key="floor.id" :list="floor"></Floor>
        <Brand></Brand>
    </div>
</template>


<script>
// <!-- 引入组件 -->
import ListContainer from '@/pages/Home/ListContainer'
import ReComend from '@/pages/Home/ReComend'
import Rank from '@/pages/Home/Rank'
import Like from '@/pages/Home/Like'
import Floor from '@/pages/Home/Floor'
import Brand from '@/pages/Home/Brand'

import { mapState } from 'vuex'

export default{
    name:'Home',
    components:{
        ListContainer,
        ReComend,
        Rank,
        Like,
        Floor,
        Brand
    },
    mounted(){
        // 派发action，获得floor数据
        this.$store.dispatch("getFloorList");
    },
    computed:{
        ...mapState({
            floorList:state=>state.home.floorList
        })
    }
}
</script>

<style  lang="less" scoped>

</style>